<template>
  <q-dialog v-model="show" persistent class="add-symbol-dialog">
    <q-card v-drag class="dialog-content" style="min-width: 400px">
      <q-card-section
        class="dialog-title bg-primary"
        style="padding-left: 0;padding-right: 0"
      >
        <div class="text-center text-white dialog-title">
          <span class="font-size-16">符号</span>
          <q-btn
            style="font-size: 18px;color: white"
            flat
            round
            dense
            class="iconfont icontubiao-67 white close-btn dialog"
            @click="$emit('close')"
          />
        </div>
      </q-card-section>
      <q-card-section>
        <div class="flex q-pa-sm">
          <div v-for="(item, index) in symbolData" :key="index" class="item" @dblclick="onSetItem(item)">{{item}}</div>
        </div>
      </q-card-section>
    </q-card>
  </q-dialog>
</template>

<script>
export default {
  name: 'add-symbol-dialog',
  computed: {},
  props: {
    show: {
      type: Boolean,
      default: false,
      required: true
    }
  },
  components: {},
  data () {
    return {
      symbolData: [
        '∮',
        '°',
        '#',
        '□',
        '±',
        '×',
        'Ⅰ',
        'Ⅱ',
        'Ⅲ',
        '⊥',
        '％',
        '■',
        '∠',
        'm',
        '◎',
        '○',
        'δ',
        'μ',
        '／',
        '◇'
      ]
    }
  },
  methods: {
    onSetItem (val) {
      this.$emit('onSetItem', val)
    }
  },
  watch: {
    show () {}
  }
}
</script>

<style scoped lang="scss">
    .item{
      width: 30px;
      height: 30px;
      text-align: center;
      line-height: 30px;
      margin: 0px 2px 2px 0px;
      border: 1px solid #d3d3d3;
      cursor: pointer;
    }

</style>
